package com.dgut.autoconfig;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.stereotype.Component;
/*
    发布类
 */
@Slf4j
@Component
public class MailSender {
    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;
    public void publishEvent(MailSendEvent event)

   {
       System.out.println("事件初始化");
        applicationEventPublisher.publishEvent(event);
    }
}
